<%--
  Created by IntelliJ IDEA.
  User: 周超
  Date: 2019/1/23
  Time: 9:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品分类修改页面</title>
</head>
<body>
<form id="myform" class="layui-form" action="/GoodsClassModifySubmitServlet" method="post">
    <input id="clid" name="clid" type="hidden" value="${goodsClass.clId}">
    <table>
        <tr><td>商品分类名称</td><td><input id="clname" name="clname" type="text" value="${goodsClass.clName}"/></td></tr><br>
        <tr><td>父级分类id</td><td><input id="faid" name="faid" type="text" value="${goodsClass.faId}"/></td></tr><br>
        <tr><td>商品描述</td><td><input id="describe" name="describe" type="text" value="${goodsClass.clDescribe}"/></td></tr><br>
        <tr><td><input id="reset" name="reset" type="reset" value="重置" onclick="giveup()"/></td>
            <td>
                <input  name="sub" type="button" value="提交"  onclick="so()"/>
            </td>
            <td>
                <input  name="sub" type="button" value="取消"  onclick="undo()"/>
            </td>
        </tr><br>
    </table>
</form>
</body>
<script>
    function so() {
        var clname=document.getElementById("clname").value;
        var faid=document.getElementById("faid").value;
        var describe=document.getElementById("describe").value;
        if(null==clname||""==clname){
            alert("商品分类名称不能为空！");
            return false;
        }
        if(null==faid||""==faid){
            alert("父级分类id不能为空！");
            return false;
        }
        if(null==describe||""==describe){
            alert("商品分类描述不能为空！");
            return false;
        }
        document.getElementById("myform").submit();
    }
    function undo() {
        window.location.href="GoodsClassPageBeanListServlet";
    }

</script>
</html>
